﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace _03.RecursiveDFS
{
    class RecursiveDFS
    {
        static void Main(string[] args)
        {
            List<int>[] nodes = new List<int>[7];
            nodes[0] = new int[]{3, 6}.ToList();
            nodes[1] = new int[]{2, 3, 4, 5, 6}.ToList();
            nodes[2] = new int[]{1, 4, 5}.ToList();
            nodes[3] = new int[]{0, 1, 5}.ToList();
            nodes[4] = new int[]{1, 2, 6}.ToList();
            nodes[5] = new int[]{1, 2, 3}.ToList();
            nodes[6] = new int[]{0, 1, 4}.ToList();

            Graph graph = new Graph(nodes);

            bool[] visited = new bool[graph.NodesCount];
            Console.WriteLine("DFS recursive traversal:");
            graph.RecursiveDFS(0, visited);
        }
    }
}
